const { DataTypes } = require('sequelize');
const { sequelize } = require('../utils/database');

const UserProfile = sequelize.define('UserProfile', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  user_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
    unique: true
  },
  interests: {
    type: DataTypes.JSON,
    allowNull: true,
    defaultValue: []
  },
  activity_preferences: {
    type: DataTypes.JSON,
    allowNull: true,
    defaultValue: {}
  },
  location_preference: {
    type: DataTypes.STRING(255),
    allowNull: true
  },
  preferred_time_slots: {
    type: DataTypes.JSON,
    allowNull: true,
    defaultValue: []
  },
  activity_frequency: {
    type: DataTypes.ENUM('low', 'medium', 'high'),
    defaultValue: 'medium'
  },
  social_level: {
    type: DataTypes.ENUM('introvert', 'ambivert', 'extrovert'),
    defaultValue: 'ambivert'
  }
}, {
  tableName: 'user_profiles',
  indexes: [
    {
      fields: ['user_id']
    }
  ]
});

module.exports = UserProfile; 